package com.yyge.controller.admin.mapstruct;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yyge.common.vo.resp.PageResp;
import com.yyge.controller.admin.product.req.ProductAddReq;
import com.yyge.controller.admin.product.req.ProductReq;
import com.yyge.controller.admin.product.resp.ProductResp;
import com.yyge.entity.Product;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface ProductConverter {
    ProductConverter MAPPER = Mappers.getMapper(ProductConverter.class);

     @Mapping(source="records",target="rows")
     PageResp<ProductResp> convert(Page list);

     Product convert(ProductReq req);
     Product convert(ProductAddReq req);
     List<ProductResp> convert(List<Product> list);

     ProductResp convert(Product obj);
}

//     @Mapping(source="records",target="rows")
//     PageResp<SysDictTypeResp> conver(Page list);
//     SysDictType conver(SysDictTypeEditReq req);
//     List<SysDictTypeResp> conver(List<SysDictType> list);
//
